home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Workbench Add-On
/
Workbench Add-On - Volume 1.iso
/
BBS-Archive
/
Comm
/
AmiTCP30b2.lha
/
src
/
util
/
ls
/
ls.h
< prev
next >
Wrap
C/C++ Source or Header
|
1994-02-24
|
3KB
|
114 lines
/* $Id: ls.h,v 1.8 1994/01/21 13:29:21 ppessi Exp $
*
* ls. - ls declarations and prototypes
*
* Copyright © 1991, 1993 Pekka Pessi. All rights reserved.
*
* Created : Tue Jan 14 16:24:22 1992 ppessi
* Last modified: Thu Jan 20 16:46:28 1994 ppessi
*/
#include <dos/dos.h>
#include <dos/exall.h>
#define ExAllData myExAllData
/*
* An extended ExAllData structure
*/
struct ExAllData {
struct ExAllData *ed_Next;
UBYTE *ed_Name;
LONG ed_Type;
ULONG ed_Size;
ULONG ed_Prot;
ULONG ed_Days;
ULONG ed_Mins;
ULONG ed_Ticks;
UBYTE *ed_Comment; /* strings will be after last used field */
UWORD ed_OwnerUID; /* new for V39 */
UWORD ed_OwnerGID;
/* NONSTANDARD */
ULONG ed_Key; /* # of key block, used for -i */
ULONG ed_Blocks; /* # of used blocks, used for -s */
};
#ifndef ED_OWNER
#define ED_OWNER (ED_COMMENT+1)
#endif
#define ED_BLK (ED_COMMENT+2)
#include <clib/dos_protos.h>
#include <clib/exec_protos.h>
#include <clib/usergroup_protos.h>
struct ExAllList {
struct ExAllList * El_Next;
int El_Number;
struct ExAllData El_Data;
};
struct options {
unsigned int longformat : 1; /* -l */
unsigned int group : 1 ; /* -g */
unsigned int sort_time : 1; /* -t */
unsigned int all : 1; /* -a */
unsigned int dotted : 1; /* -A */
unsigned int kilos : 1; /* -s */
unsigned int dir : 1; /* -d */
unsigned int reverse : 1; /* -r */
unsigned int inode : 1; /* -i */
unsigned int fast : 1; /* -f */
unsigned int filetype : 1; /* -F */
unsigned int symbolic : 1; /* -L */
unsigned int recursion : 1; /* -R */
unsigned int multicolumn : 1; /* -C */
unsigned int singlecolumn : 1; /* -1 */
unsigned int nongraph : 1; /* -q */
unsigned int pathname : 1; /* -p */
};
extern BPTR Stdin;
extern BPTR Stdout;
extern BPTR Stderr;
#define EXDATASIZE 4096 /* size for exall buffer */
#define EXLISTSIZE (EXDATASIZE + sizeof(struct ExAllList))
#define MYNOMEMERR -2
#define MAXFILENAMELEN 32
#define MAXPATHLEN 1024
__inline static int max(int a, int b) { return a > b ? a : b; }
/* ls.c */
extern struct options options;
/* short.c */
extern void doprint(char *, const struct ExAllList *, struct options);
/* list.c */
extern void bfree(volatile struct ExAllList *);
extern struct ExAllList *listdir(char *name, struct options );
extern struct ExAllList *listpatterns(int patc, char **patv, struct options);
/* sort.c */
extern void quick_sort(void *slots[], int size, int(*compare)(void *, void *));
/* user.c */
UBYTE *user(UWORD);
UBYTE *group(UWORD);
#ifdef __SASC
#define INLINE __inline
extern struct Library *DOSBase;
#include <pragmas/dos_pragmas.h>
extern struct ExecBase *SysBase;
#include <pragmas/exec_sysbase_pragmas.h>
extern struct Library *UtilityBase;
#include <pragmas/utility_pragmas.h>
#endif
#ifdef __GNUC__
#define INLINE __inline__
#endif